local function main(userOb, msgData)
    local Nowtime = os.date("%Y-%m-%d 00:00:00")
    local now_time = os.time()
    local Past_times = now_time+(3600*24)
    Past_times = os.date("%Y-%m-%d 00:00:00", Past_times)

    local userId = userOb:query_temp("userId")
    local result = {}
    local rpc = {}
    rpc.behavior = "get"
    rpc.method = "change_challenge"
    rpc.condition = string.format(" WHERE from_user='%s' and `last_update_time` BETWEEN '%s' AND '%s'", userId, Nowtime, Past_times)
    local ok, data = THREAD_D:send("database_yield", rpc) 
    result.code = 200
    result.status = "success"
    result.data = table.values(data)
    result.count = #data
    userOb:send_packet("MSGS2CGetChallenge", result)
end    

--注册方法
COMMAND_D:register_command("MSGC2SGetChallenge",GameCmdType.NONE, main)